home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / hello_localized / hello3.c < prev    next >
C/C++ Source or Header  |  1995-09-01  |  1KB  |  42 lines

  1. ;/*
  2. CatComp hello.cd CFILE hello_strings.h OBJFILE hello_strings.o
  3. CatComp hello.cd hello.ct CATALOG sys:locale/Catalogs/Français/hello.catalog NOOPTIM
  4. Quit */
  5. #define CATCOMP_NUMBERS
  6. #include "hello_strings.h"
  7. #include <libraries/locale.h>
  8. #include <pragmas/locale_pragmas.h>
  9. #include <clib/locale_protos.h>
  10. #include <string.h>
  11. #include <clib/exec_protos.h>
  12. #include <pragmas/exec_pragmas.h>
  13. #include <proto/dos.h>
  14. #include <proto/exec.h>
  15.  
  16. void PutString(int catalog_id,char *default_str);
  17.  
  18. struct Catalog *Catalog=0L;
  19. struct Library *LocaleBase=0L;
  20. struct DosLibrary *DOSBase=0L;
  21. int long OutputBase=0L;
  22.  
  23. void __saveds hello(void)
  24. {
  25.     DOSBase=OpenLibrary("dos.library", 0L);
  26.     OutputBase=Output();
  27.  
  28.     if(LocaleBase=OpenLibrary("locale.library",38)) Catalog=OpenCatalogA(NULL,"hello.catalog",NULL);
  29.  
  30.     PutString(MSG_HELLO,"Hello World!\n");
  31.  
  32.     if(Catalog)    CloseCatalog(Catalog);
  33.     if(LocaleBase)    CloseLibrary(LocaleBase); 
  34.     if(DOSBase)    CloseLibrary((struct Library *)DOSBase);
  35. }
  36.  
  37.  
  38. void PutString(int catalog_id,char *default_str)
  39. {
  40.     Write(OutputBase,GetCatalogStr(Catalog,catalog_id,default_str),strlen(GetCatalogStr(Catalog,catalog_id,default_str)));
  41. }
  42.